using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
    #region ConfigNumberService

    /// <summary>
    /// ConfigNumberService object for Ibatis mapped table 'ConfigNumber'.
    /// </summary>
    public class ConfigNumberService : IConfigNumberService
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(ConfigNumberService).Name);
        private static volatile ConfigNumberService _ConfigNumberService = null;
        public static ConfigNumberService GetInstance()
        {
            if (_ConfigNumberService == null)
            {
                lock (typeof(ConfigNumberService))
                {
                    if (_ConfigNumberService == null) // double-check
                        _ConfigNumberService = new ConfigNumberService();
                }
            }
            return _ConfigNumberService;
        }
        public ConfigNumberService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public string GetNumberCode(string _configType)
        {
            try
            {
                ConfigNumberEntity configNumberE = new ConfigNumberEntity();
                configNumberE.ConfigType = _configType;
                configNumberE = (ConfigNumberEntity)ExecuteQueryForObject("GetNumberCode", configNumberE);
                return configNumberE.NumberCode;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }

    }
    #endregion
}
